[HVM] Wake up APs immediately during restore.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 25 Jan 2007 12:28:47 +0000 (12:28 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 25 Jan 2007 12:28:47 +0000 (12:28 +0000)
From: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/hvm.c

index 1c294ca236f02f3956aefaae498f3c86e8cb84f3..44c6a4473d66b3acd4046ea2af7c94d20418c194 100644 (file)
@@ -170,12 +170,26 @@ void hvm_domain_destroy(struct domain *d)
         unmap_domain_page_global((void *)d->arch.hvm_domain.buffered_io_va);
 }
 
+int hvm_load_cpu_ctxt(hvm_domain_context_t *h, void *opaque, int version)
+{
+    struct vcpu *v = opaque;
+
+    if ( hvm_funcs.load_cpu_ctxt(h, opaque, version) < 0 )
+        return -EINVAL;
+
+    /* Auxiliary processors shoudl be woken immediately. */
+    if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+        vcpu_wake(v);
+
+    return 0;
+}
+
 int hvm_vcpu_initialise(struct vcpu *v)
 {
     int rc;
 
     hvm_register_savevm(v->domain, "xen_hvm_cpu", v->vcpu_id, 1,
-                        hvm_funcs.save_cpu_ctxt, hvm_funcs.load_cpu_ctxt, 
+                        hvm_funcs.save_cpu_ctxt, hvm_load_cpu_ctxt, 
                         (void *)v);
 
     if ( (rc = vlapic_init(v)) != 0 )